#ifndef __OLED_H
#define __OLED_H

#include "stm32f10x.h"


#define SCL_PORT			GPIOB
#define SCL_PIN				GPIO_Pin_8
#define OLED_SCL_PORT_CLK 	RCC_APB2Periph_GPIOB
#define SDA_PORT			GPIOB
#define SDA_PIN				GPIO_Pin_9
#define OLED_SDA_PORT_CLK 	RCC_APB2Periph_GPIOB

#define OLED_W_SCL(x)		GPIO_WriteBit(SCL_PORT, SCL_PIN, (BitAction)(x))
#define OLED_W_SDA(x)		GPIO_WriteBit(SDA_PORT, SDA_PIN, (BitAction)(x))



void OLED_Init(void);
void OLED_Clear(void);
void OLED_SetCursor(uint8_t Y, uint8_t X);
void OLED_WriteCommand(uint8_t Command);
void OLED_ShowChar(uint8_t row,uint8_t col,char Chr,uint8_t inv);
void OLED_ShowString(uint8_t row,uint8_t col,char *str,uint8_t inv);
int showGBK(unsigned char row,unsigned char col,uint8_t *gbk);
int OLED_Print(u8 row,u8 col,const char *formate,...);
int loadbar(u8 page,u8 percent);

#endif
